package com.fenghongzhang.a1810;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Toast;

import javax.inject.Inject;

public class MainActivity extends AppCompatActivity {


    @Inject
    User user;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //= new User();
//        DaggerActivityComponent.builder().build().zhuru(this);
//        user.setName("哈哈");
//        Toast.makeText(this, user.toString(), Toast.LENGTH_SHORT).show();

        DaggerActivityComponent.builder().userModel(new UserModel("xiaoming")).build().zhuru(this);
        Toast.makeText(this, user.getName(), Toast.LENGTH_SHORT).show();
    }
}
